<!--_meta 作为公共模版分离出去-->
<#include "include/_meta.html">
<!--/meta 作为公共模版分离出去-->

<title>车辆审核</title>
<meta name="keywords" content="汽车租赁">
<meta name="description" content="H-ui.admin v2.3，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
</head>
<body>
<article class="page-container">
    <form class="form form-horizontal" id="form-insurance-add"   >
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>审核订单ID:</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" readonly="readonly" autocomplete="off" value="${result.entityObj.checkId}" placeholder="审核订单ID" id="checkId" name="checkId" >
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>汽车ID:</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" readonly="readonly" autocomplete="off" value="${(result.entityObj.carId?c)!}" placeholder="汽车ID" id="carId" name="carId">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>订单ID：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" readonly="readonly" autocomplete="off" value="${result.entityObj.orderID}" placeholder="订单ID" id="orderID" name="orderID">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>审核人ID：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" readonly="readonly" autocomplete="off" value="${result.entityObj.userId}" placeholder="审核人ID" id="userId" name="userId">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>汽车外观：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text"   autocomplete="off" value="${result.entityObj.appearance}" placeholder="汽车外观0完好1轻微2重度3完全损毁" id="appearance" name="appearance">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>外观总赔偿价格：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" autocomplete="off" value="${(result.entityObj.appearancePrice?c)!}" placeholder="外观总赔偿价格" id="appearancePrice" name="appearancePrice" onmousemove="priceeAdd(this)">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>外观损坏备注：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <textarea id="appearanceRemarks" name="appearanceRemarks" cols="" rows="" class="textarea"  placeholder="${result.entityObj.appearanceRemarks}" dragonfly="true"></textarea>
                <p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>汽车内饰：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="textarea"  class="input-text "  autocomplete="off" value="${result.entityObj.interior}"  placeholder="0完好1轻微2重度3完全损毁" id="interior" name="interior">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>内饰总赔偿价格：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" autocomplete="off" value="${(result.entityObj.interiorPrice?c)!}" placeholder="内饰总赔偿价格" id="interiorPrice" name="interiorPrice" onmousemove="priceeAdd(this)">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>内饰损坏备注：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <textarea id="interiorRemarks" name="interiorRemarks" cols="" rows="" class="textarea"  placeholder="${result.entityObj.interiorRemarks}" dragonfly="true" ></textarea>
                <p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p>
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>违章总罚款：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" autocomplete="off" value="${(result.entityObj.violationPrice?c)!}" placeholder="违章总罚款" id="violationPrice" name="violationPrice" onmousemove="priceeAdd(this)">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>审核后应赔偿总价：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" readonly="readonly" autocomplete="off" value="${(result.entityObj.checkPrice?c)!}" placeholder="审核后应赔偿总价" id="checkPrice" name="checkPrice">
            </div>
        </div>

        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input onclick="valitade(this)" class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;"/>
                <input onclick="closec()" id="cancelBtn" class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;取消&nbsp;&nbsp;"/>
            </div>
        </div>
    </form>
</article>

<!--_footer 作为公共模版分离出去-->
<#include "include/_footer.html">
<!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
   var t1 = "${result.entityObj.appearanceRemarks}";
   var t2 = "${result.entityObj.interiorRemarks}";
   console.log(t1);
   console.log(t2);
   $("#appearanceRemarks").val(t1);
   $("#interiorRemarks").val(t2);

   var priceeAdd = function (obj) {
        var p1 = parseFloat($("#appearancePrice").val());
        var p2 = parseFloat($("#interiorPrice").val());
        var p3 = parseFloat($("#violationPrice").val());
        console.log("p1 ="+p1);
        console.log("p2 ="+p2);
        console.log("p3 ="+p3);
        var pA = parseFloat(p1+p2+p3);
        $("#checkPrice").val(pA);
    }



    var closec = function () {
        var thisName = parent.layer.getFrameIndex(window.name);
        parent.layer.close(thisName);
    }

    var valitade = function () {
        let mustData = ['checkId','carId','orderID','userId','appearance','appearancePrice','appearanceRemarks','interior','interiorPrice','interiorRemarks','violationPrice','checkPrice'];
        let mustDataTip = ['审核订单ID不能为空','汽车ID不能为空','订单ID不能为空','审核人ID不能为空','汽车外观不能为空','外观总赔偿价格不能为空','外观损坏备注不能为空','汽车内饰不能为空','内饰总赔偿价格不能为空','内饰损坏备注不能为空','违章总罚款不能为空','审核后应赔偿总价不能为空'];
        let canSet = true;
        console.log(this.form);
        for(let i=0;i<mustData.length;i++) {
            if($("#"+mustData[i]).val()==''){
                layer.msg("必填:"+mustDataTip[i], {icon: 5});

                canSet = false;
                break;
            }
        };
        if(canSet){
            $.ajax({
                type: "POST",
                url: "/TwopdateCheck",
                data: $("#form-insurance-add").serialize(),
                dataType: "json",
                success: function (result) {
                    if(result.flag==1){
                        layer.msg(result.flag+":"+result.msg, {icon: 6});
                    }else{
                        layer.msg(result.flag+":"+result.msg, {icon: 5});
                    }
                    closec();
                }
            });
        }
    }

</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
